#find the product abc of the pythagorean triplet abc where a+b+c=1000

import math

class pythagorean_triplet():
	a,b = 0,0	
	def __init__(self): pass
	def __iter__(self):
		return self
	def __next__(self):
		if self.b >= self.a: 
			self.a+=1
			self.b=0
		else: self.b+=1

		c = math.sqrt(self.a**2+self.b**2)
		return (self.a, self.b, c)

if __name__ == "__main__":
	itr = iter( pythagorean_triplet() )
	i = 0
	for t in itr: 
		i += 1
		a,b,c = t[0],t[1],t[2]
		k = a+b+c
		if k == 1000: 
			print("dudee {0}".format(t))
			print(a*b*c)
			break
		if i >= 707001:
			break	
